﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PacketRush.Core.DocExamples
{
    public class PacketWriterExamples
    {
        public void Example01()
        {
            #region Example01

            // Create an instance of PacketWriter
            PacketWriter writer = new PacketWriter();

            // Write a string with utf-8 encoding
            writer.Write("Hello, World!", Encoding.UTF8);

            // Write a float
            writer.Write(120.0f);

            // Copy the contents of the writer to a new strongly typed packet
            Packet packet = writer.ToPacket(PacketFlags.Reliable);

            #endregion
        }
    }
}
